package jiekou;

import java.awt.*;

interface Ishape{
     int a = 10;//常量  默认为public static final
     void draw();//抽象方法  默认为 public abstract
    //Java8后允许
     default public void set(){
         System.out.println("666");
     }
     public static void get(){
         System.out.println("画图");
     }
}
class Ract implements Ishape{
    @Override
    public void draw() {
        System.out.println("矩形");
    }

    @Override
    public void set() {
        Ishape.super.set();
    }
}
class Flower implements Ishape{
    @Override
    public void draw() {
        System.out.println("❀");
    }
}
public class Test {
    public static void draw3(Ishape ishape){
        ishape.draw();
    }
    public static void main(String[] args) {
        //接口也可以发生向上转型和动态绑定
        Ract ract = new Ract();
        draw3(ract);
        Flower flower = new Flower();
        draw3(flower);
    }
}
